import {defineStore} from 'pinia'

export const useOnAddStore = defineStore('onAdd', {
    state() {
        return {
            addRess: { username: '', tel: '', address: '' },
            orderid:[]
        }
    },
    actions: {
        saveAddRess(_addRess: any) {
            this.addRess = _addRess
        },
        saveOrderid(id:any){
            this.orderid = id
        }
    },
    getters:{
        getOrderid():any{
            return this.orderid
        }
    },
    persist: {
        enabled: true,
        strategies: [
            {
                key: 'onAdd', //设置存储的key
                storage: localStorage, //表示存储在localStorage
            },
        ],
    },
})